package com.fdd.furns.service.impl;

import com.fdd.furns.dao.MemberDAO;
import com.fdd.furns.dao.impl.MemberDAOImp;
import com.fdd.furns.pojo.Member;
import com.fdd.furns.service.MemberService;

public class MemberServiceImpl implements MemberService {
    MemberDAO memberDAO = new MemberDAOImp();
    @Override
    public boolean isExist(String name) {
        return memberDAO.queryMemberByName(name) != null;
    }

    @Override
    public boolean registerMember(Member member) {
        return memberDAO.saveMember(member) > 0;
    }

    @Override
    public Member login(Member member) {
       return memberDAO.queryMemberByNameAndPwd(member.getName(), member.getPassword());
    }

}
